package com.city.service.pub.impl;

import com.city.domain.pub.PubCount;
import com.city.repository.party.PubCountryRepository;
import com.city.repository.pub.PubCountRepository;
import com.city.service.pub.PubCountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.ExampleMatcher;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @deprecation:
 * @dmail: 398521613@qq.com
 * @author: L-H
 * @date: 2018-07-25 16:37
 */
@Service
public class PubCountServiceImpl implements PubCountService {

    @Autowired
    private PubCountRepository countRepository;

    @Override
    public List<PubCount> getAll(PubCount pubCount) {
        //创建匹配器，即如何使用查询条件
        ExampleMatcher matcher = ExampleMatcher.matching(); //构建对象

        //创建实例
        Example<PubCount> ex = Example.of(pubCount, matcher);

        //查询
        return countRepository.findAll(ex);
    }
}
